
package com.xbongbong.message.domain.dao;

import com.xbongbong.message.domain.entity.PushEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * PushDao
 *
 * @author GuoJun.HU
 * @since V1.0
 * @date 2019/2/19 10:47
 */
@Repository
@Mapper
public interface PushDao {

    Integer insert(PushEntity push);

    void insertBatch(List<PushEntity> pushList);

    Integer update(PushEntity push);

    Integer deleteByKey(@Param("key") Integer key, @Param("corpid") String corpid);

    PushEntity getByKey(@Param("key") Integer key, @Param("corpid") String corpid);

    List<PushEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    Integer deleteByIdIn(@Param("idIn") List<Long> pushIdIn, @Param("corpid")String corpid);

    /**
     * 根据refId(关联的业务的具体表中的数据)去批量删除tb_push消息表中的消息
     *
     * @param dataIdList refId列表
     * @param corpid
     * @return
     */
    Integer deleteByRefIds(@Param("dataIdIn") List<Long> dataIdList, @Param("corpid")String corpid);

    List<Long> getAlreadyProduceId(@Param("corpid")String corpid,@Param("todayInt") Long todayInt, @Param("todayEndInt")Long todayEndInt, @Param("subCode")Integer subCode, @Param("type") Integer type);
}